<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="close()">
        <span aria-hidden="true">×</span></button>
    <h4 class="modal-title">动态参数设置</h4>
</div>
<div class="modal-body">
    <div class="row">
        <div class="col-md-12 form-horizontal">

            <div class="form-group">
                <label class="col-sm-3 control-label">名称&nbsp;<span class="red">*</span></label>

                <div class="col-sm-9">
                   <input class="form-control" readonly ng-model="parameter.name"  placeholder="报表查询参数名称" required="required" maxlength="20">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">标题&nbsp;<span class="red">*</span></label>
                <div class="col-sm-9">
                    <input class="form-control" ng-model="parameter.text"  placeholder="询参数对应的标题" required="required"  maxlength="20">
                    <!--<textarea ng-model="data.expression" id="expression_area" class="form-control" placeholder="{{'TIPS.CAL_EXPR'|translate}}"></textarea>-->
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">表单类型&nbsp;<span class="red">*</span></label>
                <div class="col-sm-9">
                    <select ng-model="parameter.formElement" ng-change="changeType()" class="form-control" required="required">
                        <option value="text">text(文本)</option>
                        <option value="date">date(时间)</option>
                        <option value="select">select(下拉框)</option>
                        <option value="tree">tree</option>
                    </select>
                </div>
            </div>
            <div ng-if="!treeFlag">
                <div class="form-group">
                    <label class="col-sm-3 control-label">数据类型&nbsp;<span class="red">*</span></label>
                    <div class="col-sm-9" required="required">
                        <select ng-model="parameter.dataType"  class="form-control" required="required">
                            <option value="string" >string</option>
                            <option value="float">float</option>
                            <option value="integer">integer</option>
                            <option value="date">date</option>
                        </select>
                    </div>
                </div>
                <div class="form-group" ng-show="showContent">
                    <label class="col-sm-3 control-label">数据来源&nbsp;<span class="red">*</span></label>
                    <div class="col-sm-9">
                        <select ng-model="parameter.dataSource" ng-change="changeSourceType()" class="form-control" required="required" >
                            <option value="text">text</option>
                            <option value="sql">sql</option>
                        </select>
                    </div>
                </div>
                <div class="form-group" ng-show="showContent">
                    <label class="col-sm-3 control-label">内容&nbsp;<span class="red">*</span></label>
                    <div class="col-sm-9">
                        <textarea ng-model="parameter.content"  class="form-control" ></textarea>
                        <span class="tip">{{sourceTip}}</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">默认值&nbsp;<span class="red">*</span></label>
                    <div class="col-sm-9" ng-if="parameter.formElement=='date'">
                        <input class="form-control Wdate" readonly id="defaultValue"  ng-model="$parent.parameter.defaultValue"  required="required" id="defaultValue" onClick='WdatePicker()' placeholder="默认值">
                    </div>
                    <div class="col-sm-9" ng-if="parameter.formElement!='date'">
                        <input class="form-control" ng-model="parameter.defaultValue"  required="required" placeholder="默认值">
                    </div>
                </div>
                <div class="form-group" ng-repeat="alert in alerts">
                    <div class="col-sm-offset-3 col-sm-9">
                        <div uib-alert ng-class="'alert-' + (alert.type || 'warning')"
                             close="alerts.splice($index, 1)">{{alert.msg}}
                        </div>
                    </div>
                </div>
            </div>

            <div ng-if="treeFlag">


                <div class="form-group" >
                    <label class="col-sm-3 control-label">内容&nbsp;<span class="red">*</span></label>
                    <div class="col-sm-9">
                        <textarea ng-model="parameter.content"  class="form-control" ></textarea>
                        <span class="tip">输入sql</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">默认值&nbsp;<span class="red">*</span></label>

                    <div class="col-sm-9">
                        <input class="form-control" ng-model="parameter.defaultValue"  required="required" placeholder="默认值" >
                        <span class="tip">默认值格式为{"key":1,"value":"河北建投"}</span>
                    </div>
                </div>
                <div class="form-group" ng-repeat="alert in alerts">
                    <div class="col-sm-offset-3 col-sm-9">
                        <div uib-alert ng-class="'alert-' + (alert.type || 'warning')"
                             close="alerts.splice($index, 1)">{{alert.msg}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default pull-left" data-dismiss="modal" ng-click="close()">{{'COMMON.CANCEL'|translate}}</button>
    <!--<button type="button" class="btn btn-primary" ng-click="verify()">{{'CONFIG.WIDGET.CHECK'|translate}}</button>-->
    <button type="button" class="btn btn-primary" ng-click="ok()">{{'COMMON.OK'|translate}}</button>
</div>